<script setup>
import useCommonStore from "@/store/modules/common";
const commonStore = useCommonStore();


const props = defineProps({
  valueKey: {
    type: String,
    default: 'value'
  }
})

const optionsList = computed(() => {
  if (!commonStore.currencyOptions.length) {
    commonStore.getCurrencyList()
  }
  return commonStore.currencyOptions
})

defineExpose({
  optionsList
})


</script>

<template>
  <el-select v-bind="$attrs" filterable class="select-wrap">
    <el-option
        v-for="item in optionsList"
        :key="item.value"
        :label="item.label"
        :value="item[valueKey]"
    />
  </el-select>
</template>

<style scoped lang="scss">

</style>